function [labels, dx, bp] = visEmbeddedGrid(filename, showBdryPoint)
%visEmbeddedGrid Summary of this function goes here
%   Detailed explanation goes here
    hd = fopen(filename, 'rb');
    labels = readTensor(hd, 'int32');
    labels(labels == -2) = -1;
    D = ndims(labels);
    dx = fread(hd, [1 D], 'double');
    nbp = fread(hd, 1, 'int32');
    bp = fread(hd, [D nbp], 'double');
    fclose(hd);
    boxSize = size(labels);
    domainSize = boxSize .* dx;
    
    if D == 2
        figure;
        imagesc([dx(2)/2 domainSize(2) - dx(2)/2], ...
            [dx(1)/2 domainSize(1) - dx(1)/2], ...
            labels);
        axis equal;
        ax = gca;
        ax.XTick = linspace(0, domainSize(2), boxSize(2) + 1);
        ax.XTickLabel = '';
        ax.YTick = linspace(0, domainSize(1), boxSize(1) + 1);
        ax.YTickLabel = '';
        grid on;
        hold on;
        if nargin <= 1 || showBdryPoint == true
            plot(bp(2,:), bp(1,:), ...
                'kx', 'MarkerSize', 10, 'LineWidth', 1);
        end
        camroll(90);
    end
end

